package org.apache.flink.runtime.rest.messages;

import org.apache.flink.api.common.ConsumerID;

/** Path parameter identifying jobs. */
public class ConsumerIDPathParameter extends MessagePathParameter<ConsumerID> {

    public static final String KEY = "consumerid";

    public ConsumerIDPathParameter() {
        super(KEY);
    }

    @Override
    protected ConsumerID convertFromString(String value) {
        return ConsumerID.fromHexString(value);
    }

    @Override
    protected String convertToString(ConsumerID value) {
        return value.toString();
    }

    @Override
    public String getDescription() {
        return "32-character hexadecimal string value that identifies a consumer.";
    }
}
